#include <QtPlugin>
#include "Editors.h"
#include "Include/IEditor.h"
#include "TextEditor.h"
#include "PythonEditor.h"
#include "HTMLEditor.h"
#include "EditorContainer.h"

namespace Plugins
{

IEditor * Editors::createEditor(EditorType type, QWidget * parent)
{
    switch(type){
    case Text: return new EditorContainer(new TextEditor(), parent, _project);
    case Jinja: case XML: return new EditorContainer(new HTMLEditor(), parent, _project);
    default:  return new EditorContainer(new PythonEditor(), parent, _project);
    }
}

void Editors::setProject(Project *prj)
{
    _project = prj;
}

}

Q_EXPORT_PLUGIN2(texteditor, Plugins::Editors)
